<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/views/common/include/taglib.jsp"%>
	
	<script src="${ctx}/js/controllers/order/OrderListController.js" type="text/javascript"></script>
       	  <div style="top:130px;position:fixed;height:30px;font-size: 14px;font-family: '微软雅黑';margin-left:-236px;">
				当前位置：${sessionScope.currcent_position}
          </div>
          <section>
              <section>
                <div>
                     <div class="orderdetail_header">
						 <span><img style="padding: 0px 16px 3px 34px;" src="${ctx}/images/seller/goods/orderinfo.png" /></span>
						 <span>订单编号：${orderDetail.orderNumber}</span>
						 <span style="float:right;padding-right:38px;"><fmt:formatDate  value="${orderDetail.createTime}" type="both" pattern="yyyy.MM.dd HH:mm:ss" /></span>
						 <span style="float:right;padding-right: 41px;color:#709DCA;">
						 	<c:if test="${orderDetail.state == 0 }">
						 		待付款
						 	</c:if>
						 	<c:if test="${orderDetail.state == 1 }">
						 		待确认
						 	</c:if>
						 	<c:if test="${orderDetail.state == 2 }">
						 		待发货
						 	</c:if>
						 	<c:if test="${orderDetail.state == 3 }">
						 		配送中
						 	</c:if>
						 	<c:if test="${orderDetail.state == 4 }">
						 		已完成
						 	</c:if>
						 	<c:if test="${orderDetail.state == 5 }">
						 		已取消
						 	</c:if>
						 	<c:if test="${orderDetail.state == 6 }">
						 		退款申请
						 	</c:if>
						 	<c:if test="${orderDetail.state == 7 }">
						 		退款已确认
						 	</c:if>
						 	<c:if test="${orderDetail.state == 8 }">
						 		退款已完成
						 	</c:if>
						 	<c:if test="${orderDetail.state == 9 }">
						 		待消费订单
						 	</c:if>
						 	<c:if test="${orderDetail.state == 10 }">
						 		退货申请
						 	</c:if>
						 	<c:if test="${orderDetail.state == 11 }">
						 		退货已确认
						 	</c:if>
						 	<c:if test="${orderDetail.state == 12 }">
						 		退货已完成
						 	</c:if>
						 	<c:if test="${orderDetail.state == 13 }">
						 		退货已拒绝
						 	</c:if>
						 	<c:if test="${orderDetail.state == 14 }">
						 		配送已送达
						 	</c:if>
						 </span>
					</div>
					<div>
						<c:forEach items="${orderDetail.orderDetails }" var="orderDetail" varStatus="status">
							<div style="height:108px;border:1px solid #E6E6E6;margin-top: -1px;font-family: '微软雅黑';font-size:14px;">
								<span>
									<c:if test="${orderDetail.goodsLogo != null}">
										<a onclick="orderDetail(${order.id});"><img width="82px;" height="73px;"  style="margin: 18px 0px 16px 30px;border-radius: 10px;" src="${sessionScope.image_logo}${orderDetail.goodsLogo }" /></a>
									</c:if>
									<c:if test="${orderDetail.goodsLogo == null}">
										<a onclick="orderDetail(${order.id});"><img width="82px;" height="73px;"  style="margin: 18px 0px 16px 30px;border-radius: 10px;" src="${ctx}/images/seller/common/defaultgoods.jpg" /></a>
									</c:if>
								</span>
								<span style="padding-left:20px;">${orderDetail.goodsName}</span>
								<span>&times;${orderDetail.amount}</span>
							</div>
						</c:forEach>
					</div>
					<div>
						<table class="table" style="margin-top:14px;float:none;">
							<thead>
								<tr>
									<th width="50%;" style="text-align: left;padding-left:30px;border: #e6e6e6 1px solid;background-color: #fff;height:45px;line-height: 45px;">
										<span><img style="padding: 0px 16px 3px 0px;" src="${ctx}/images/seller/goods/orderinfo.png" /></span>
										<span style="color:#262535;font-size:14px;">商品总价</span>
									</th>
									<th style="text-align: left;padding-left:30px;border: #e6e6e6 1px solid;background-color: #fff;height:45px;line-height: 45px;">
										<span><img style="padding: 0px 16px 3px 0px;" src="${ctx}/images/seller/goods/orderinfo.png" /></span>
										<span style="color:#262535;font-size:14px;">买家留言</span>
									</th>
								</tr>
							</thead>
							<tbody id="tbody">
								<tr>
									<td style="text-align: left;padding:10px 30px;">
										<div class="orderdetail_info">
											<span>商品总价：</span>
											<span style="color:#403B3B;font-weight: bold;padding-left:27px;">￥${orderDetail.totalPrice }</span>
										</div>
										<div class="orderdetail_info">
											<c:if test="${orderDetail.couponPrice > 0}">
												<span>优惠券抵扣：</span>
												<span style="color:#403B3B;font-weight: bold;padding-left:27px;">￥${orderDetail.couponPrice }</span>
											</c:if>
										</div>
										<div class="orderdetail_info">
											<span>实付款：</span>
											<span style="color:#BF373C;font-weight: bold;padding-left:27px;">￥${orderDetail.totalPrice + orderDetail.carriage - orderDetail.couponPrice}</span>
										</div>
									</td>
									<td style="text-align: left;padding:10px 30px;border:1px solid #E5E5E5;color:#919191;">
										<div style="margin:26px 33px;height:110px;background-color:#FAFAFA;padding:5px 20px;">
											${orderDetail.shopMsg}
										
										</div>
									</td>
									
								</tr>
							</tbody>
						</table>
					</div>
					
					<div>
						<table class="table" style="margin-top:14px;float:none;">
							<thead>
								<tr>
									<th width="50%;" style="text-align: left;padding-left:30px;border: #e6e6e6 1px solid;background-color: #fff;height:45px;line-height: 45px;">
										<span><img style="padding: 0px 16px 3px 0px;" src="${ctx}/images/seller/goods/orderinfo.png" /></span>
										<span style="color:#262535;font-size:14px;">配送信息</span>
									</th>
									<th style="text-align: left;padding-left:30px;border: #e6e6e6 1px solid;background-color: #fff;height:45px;line-height: 45px;">
										<span><img style="padding: 0px 16px 3px 0px;" src="${ctx}/images/seller/goods/orderinfo.png" /></span>
										<span style="color:#262535;font-size:14px;">收货信息</span>
									</th>
								</tr>
							</thead>
							<tbody id="tbody">
								<tr>
									<td style="text-align: left;padding:10px 30px;">
										<div class="orderdetail_info">
											<span>配送管理员：</span>
											<span>${orderDetail.assignName }</span>
										</div>
										<div class="orderdetail_info">
											<span>配送员：</span>
											<span>${orderDetail.senderName }</span>
										</div>
										<div class="orderdetail_info">
											<span><img src="${ctx}/images/seller/order/contactorlogo.png" /></span>
											<span style="padding-left:10px;"><img src="${ctx}/images/seller/news/phone.png" /></span>
											<span>${orderDetail.senderPhone }</span>
										</div>
									</td>
									<td style="text-align: left;padding:10px 30px;border:1px solid #E5E5E5;">
										<div class="orderdetail_info">
											<span>联系人：</span>
											<span>${orderDetail.contactor }</span>
										</div>
										<div class="orderdetail_info">
											<span>送货地址：</span>
											<span>${orderDetail.contactorAddress }</span>
										</div>
										<div class="orderdetail_info">
											<span><img src="${ctx}/images/seller/order/contactorlogo.png" /></span>
											<span style="padding-left:10px;"><img src="${ctx}/images/seller/news/phone.png" /></span>
											<span>${orderDetail.contactorPhone }</span>
										</div>
									</td>
									
								</tr>
							</tbody>
						</table>
					</div>
					<div style="margin-top:14px;border:1px solid #e6e6e6;height:300px;">
						<div style="float:left;width:60%;padding:20px 34px;font-size: 14px;font-family: '微软雅黑'">
							<div style="border-bottom:1px dashed #E5E5E5;padding:10px 0px;">
								<span><img src="${ctx}/images/seller/order/start.png" /></span>
								<span>下单时间：</span>
								<span><fmt:formatDate  value="${orderDetail.createTime}" type="both" pattern="yyyy-MM-dd   HH:mm:ss" /></span>
							</div>
							<div style="border-bottom:1px dashed #E5E5E5;padding:10px 0px;">
								<span><img src="${ctx}/images/seller/order/start.png" /></span>
								<span>确认时间：</span>
								<span><fmt:formatDate  value="${orderDetail.sureTime}" type="both" pattern="yyyy-MM-dd   HH:mm:ss" /></span>
							</div>
							<div style="border-bottom:1px dashed #E5E5E5;padding:10px 0px;">
								<span><img src="${ctx}/images/seller/order/start.png" /></span>
								<span>指派时间：</span>
								<span><fmt:formatDate  value="${orderDetail.rushTime}" type="both" pattern="yyyy-MM-dd   HH:mm:ss" /></span>
							</div>
							<div style="border-bottom:1px dashed #E5E5E5;padding:10px 0px;">
								<span><img src="${ctx}/images/seller/order/start.png" /></span>
								<span>发货时间：</span>
								<span><fmt:formatDate  value="${orderDetail.sendTime}" type="both" pattern="yyyy-MM-dd   HH:mm:ss" /></span>
							</div>
							<div style="border-bottom:1px dashed #E5E5E5;padding:10px 0px;">
								<span><img src="${ctx}/images/seller/order/start.png" /></span>
								<span>送达时间：</span>
								<span><fmt:formatDate  value="${orderDetail.arriveTime}" type="both" pattern="yyyy-MM-dd   HH:mm:ss" /></span>
							</div>
							<div style="margin-top:10px;margin-left:20px;">
								
								<c:if test="${orderDetail.state == 0}">
									<div class="orderdetail_state">待付款</div>
								</c:if>
								<!-- 状态为待确认（1），且商品为需确认那一类  -->
								<c:if test="${orderDetail.state == 1 && orderDetail.isNeedConfirm == 1}">
									<div class="orderdetail_state">待确认</div>
									<div class="orderchange">
									
										<!--点击确认，如果商品是配送那一类，不自提，跳转待发货  -->
										<c:if test="${orderDetail.distributionType == 1 && orderDetail.isBySelf == 0}">
											<a style="color: #F0AE3B;font-size: 14px;" onclick="changeState('${orderDetail.id}','${orderDetail.state}',1);">确&nbsp;&nbsp;认</a>
										</c:if>
										
										<!--点击确认，如果商品是配送那一类并且自提，或者商品不是配送那一类，都跳转待消费  -->
										<c:if test="${(orderDetail.distributionType == 1 && orderDetail.isBySelf == 1) || orderDetail.distributionType == 0}">
											<a style="color: #F0AE3B;font-size: 14px;" onclick="changeState('${orderDetail.id}','${orderDetail.state}',2);">确&nbsp;&nbsp;认</a>
										</c:if>
									
									</div>
									
									<div class="orderchange">
										<!--点击拒绝，跳转待退款订单（7）  -->
										<a style="color: #F0AE3B;font-size: 14px;" onclick="changeState('${orderDetail.id}','${orderDetail.state}',3);">拒&nbsp;&nbsp;绝</a>
									</div>
								</c:if>
								
								<c:if test="${orderDetail.state == 2}">
									<div class="orderdetail_state">待发货</div>
									<div class="orderchange">
										<!--点击发货，跳转待收货订单（3）  -->
										<a style="color: #F0AE3B;font-size: 14px;" onclick="changeState('${orderDetail.id}','${orderDetail.state}');">发&nbsp;&nbsp;货</a>
									</div>
								</c:if>
								
								<c:if test="${orderDetail.state == 3}">
									<div class="orderdetail_state">配送中</div>
								</c:if>
								<c:if test="${orderDetail.state == 4}">
									<div class="orderdetail_state">已完成</div>
								</c:if>
								<c:if test="${orderDetail.state == 5}">
									<div class="orderdetail_state">已取消</div>
								</c:if>
								<c:if test="${orderDetail.state == 6}">
									<div class="orderdetail_state">退款申请</div>
									<div class="orderchange">
										<!--点击同意，跳转待退款订单（7）  -->
										<a style="color: #F0AE3B;font-size: 14px;" onclick="changeState('${orderDetail.id}','${orderDetail.state}',4);">同&nbsp;&nbsp;意</a>
									</div>
									<div class="orderchange">
										<!--点击拒绝，跳转待确认（1）  -->
										<a style="color: #F0AE3B;font-size: 14px;" onclick="changeState('${orderDetail.id}','${orderDetail.state}',5);">拒&nbsp;&nbsp;绝</a>
									</div>
								</c:if>
								<c:if test="${orderDetail.state == 7}">
									<div class="orderdetail_state">退款已确认</div>
								</c:if>
								<c:if test="${orderDetail.state == 8}">
									<div class="orderdetail_state">退款已完成</div>
								</c:if>
								<c:if test="${orderDetail.state == 9}">
									<div>待消费订单</div>
								</c:if>
								<c:if test="${orderDetail.state == 10}">
									<div class="orderdetail_state">退货申请</div>
									<div class="orderchange">
										<!--点击同意，跳转退货已确认（11）  -->
										<a style="color: #F0AE3B;font-size: 14px;" onclick="changeState('${orderDetail.id}','${orderDetail.state}',6);">同&nbsp;&nbsp;意</a>
									</div>
									<div class="orderchange">
										<!--点击拒绝，跳转已完成订单（4）  -->
										<a style="color: #F0AE3B;font-size: 14px;" onclick="changeState('${orderDetail.id}','${orderDetail.state}',7);">拒&nbsp;&nbsp;绝</a>
									</div>
								</c:if>
								<c:if test="${orderDetail.state == 11}">
									<div class="orderdetail_state">退货已确认</div>
								</c:if>
								<c:if test="${orderDetail.state == 12}">
									<div class="orderdetail_state">退货已完成</div>
								</c:if>
								<c:if test="${orderDetail.state == 14}">
									<div class="orderdetail_state">配送已送达</div>
								</c:if>
							</div>
						</div>
						<div style="float:left;margin-top:58px;padding-left:60px;">
							<img width="160px;" height="160px;" src="${ctx}/images/seller/order/orderdetail.png" />
						</div>
					</div>
                  
                </div>
              </section>
             </section>
              
		<script type="text/javascript">
		var ctx = '${ctx}';
		setCtx(ctx);

	</script>
	<!-- 解决ie 6 7 8 9不能显示placeholder的问题 -->
	<script src="${ctx}/js/lib/jquery.JPlaceholder.js"></script>
